﻿using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using CimeaSoft.BE;

namespace CimeaSoft.Repository.Mapping
{
    public class MuestraResumenMap:EntityTypeConfiguration<MuestraResumen>
    {
        public MuestraResumenMap()
        {
            //Primary Key
            this.HasKey(t => t.Id);

            //Properties
            this.Property(t => t.Cera)
                .HasMaxLength(30);

            this.Property(t => t.NumMuestra)
                .HasMaxLength(50);

            this.Ignore(t => t.Chk);

            //Table & Column Mappings
            this.ToTable("MuestraResumen");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.ABI).HasColumnName("ABI");
            this.Property(t => t.Cera).HasColumnName("Cera");
            this.Property(t => t.IHF).HasColumnName("IHF");
            this.Property(t => t.QBR_And).HasColumnName("QBR_And");
            this.Property(t => t.NumMuestra).HasColumnName("NumMuestra");
            this.Property(t => t.IdMuestra).HasColumnName("IdMuestra");

            //Relationships
            this.HasRequired(t => t.Muestra)
                .WithMany(t => t.MuestraResumen)
                .HasForeignKey(d => d.IdMuestra);
        }
    }
}
